home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 75 / XENIATGM75.iso / Shareware / X-Setup 5.0 / _SETUP.1 / XQ DMA Harddisc NT.xpl < prev    next >
Text File  |  1999-04-08  |  3KB  |  115 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 3.1"
  2. "TYPE"="6"
  3. "COUNT"="2"
  4. "UIPATH"="Hardware\NT DMA Hard-disc"
  5. "NAME"="DMA Mode"
  6. "LANGUAGE"="VBScript"
  7. "TEXT 1"="Activate DMA mode for Port One"
  8. "TEXT 2"="Activate DMA mode for Port Two"
  9. "DESCRIPTION 1"="Use this settings to activate or deactivate the DMA mode for your hard-disc(s). If you are using DMA, your hard-disc will be much faster than in default mode."
  10. "DESCRIPTION 2"="After activating this setting, you need to restart your PC. If the setting is enabled after this restart, your hard-disc does support DMA."
  11. "DESCRIPTION 3"="If the setting is deactivated again, your hard-disc does not support DMA."
  12. "AUTHOR"="Xteq Systems"
  13. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  14. "COMMENT 1"="For more information, go to http://www.xteq.com or write to TeXHeX@xteq.com."
  15. "COMMENT 2"="Version 1.2"
  16.  
  17.  
  18.  
  19. '//I like REG files... ;)
  20. '[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\atapi\Parameters\Device0]
  21. '"DriverParameter"="DmaDetectionLevel = 0x1;"
  22. '
  23. '//Old Stuff...
  24. 'sOK="YES, DMA is enabled!"
  25. 'sNO="DMA is NOT enabled"
  26. 'sNP="Port does not exists"
  27.  
  28.  
  29. sParaPath="HKLM\SYSTEM\CurrentControlSet\Services\atapi\Parameters\Device"
  30. sParaValueName="DriverParameter"
  31. sParaValue="DmaDetectionLevel = 0x1;"
  32.  
  33.  
  34. sPath="HKLM\Hardware\DeviceMap\Scsi\Scsi Port "
  35. sValue="\DMAEnabled"
  36.  
  37. 'Called when the Plugin is started
  38. SUB Plugin_Initialize
  39.  if GetWinVer=2 then
  40.   Call CheckPort(1)
  41.   Call CheckPort(2)
  42.  else
  43.   Call Disable
  44.  end if
  45. END SUB
  46.  
  47.  
  48. Sub CheckPort(ID)
  49.  s=sPath & ID-1 & "\"
  50.  'Call DebugMsg(s)
  51.  
  52.  if RegPathExists(s) then
  53.   if RegReadValue(s & sValue)=1 then
  54.    SetUIElement ID,True 'sOK
  55.   else
  56.    SetUIElement ID,False 'sNO
  57.   end if
  58.  else
  59.   SetUIElement ID,False 'sNP
  60.  end if
  61. End Sub
  62.  
  63.  
  64. 'Called when the Plugin should validate the Data the user has entered
  65. SUB Plugin_CheckData(ElementIndex)
  66. END SUB
  67.  
  68. 'Called when the Plugin should apply the changes
  69. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  70.  b=GetUIElement(1)
  71.  if b=True then
  72.   Call EnableDMA(0)
  73.  else
  74.   Call DisableDMA(0)
  75.  end if
  76.  
  77.  b=GetUIElement(2)
  78.  if b=True then
  79.   Call EnableDMA(1)
  80.  else
  81.   Call DisableDMA(1)
  82.  end if
  83.  
  84.  
  85.  Call MsgWarning("Changes have been applied. You should restart your computer NOW because the changes you have made will not be visible until you have restarted.")
  86.  Call Restart
  87. END SUB
  88.  
  89.  
  90. Sub EnableDMA(DevID)
  91.  s=sParaPath & DevID & "\"
  92.  s=s & sParaValueName
  93.  
  94.  Call RegWriteValue(s,sParaValue,1)
  95. End Sub
  96.  
  97. Sub DisableDMA(DevID)
  98.  s=sParaPath & DevID & "\"
  99.  s=s & sParaValueName
  100.  
  101.  s2=RegReadValue(s)
  102.  
  103.  if IsEmpty(s2)=false then
  104.   Call RegDeleteValue(s)
  105.  end if
  106. End Sub
  107.  
  108.  
  109.  
  110. 'Called when the Plugin is about to be removed from memory
  111. SUB Plugin_Terminate
  112. END SUB
  113.  
  114.  
  115.